Count the frequency of words in a file using a hash table#66
Count the frequency of words in a file using a hash table#66
Conversation
New singly linked list
added a function to count the number of duplicate elements
… into FrequencyOfOccurrenceOfWords
… into FrequencyOfOccurrenceOfWords
yurii-litvinov
left a comment
There was a problem hiding this comment.
Не работает совсем :) У Вас, наверное, тоже. Можно было спросить, почему :)
There was a problem hiding this comment.
Вообще, .sln описывает целую программную систему. У Вас на каждый модуль свой .sln, что совершенно не нужно. Придерживайтесь принципа "Одна задача --- один .sln-файл", за исключением разве что кода, переиспользуемого между несколькими задачами.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Это можно было унифицировать с createTable, передавая туда начальный размер таблицы. Кстати, библиотечные словари во многих языках так и делают, принимают желаемый начальный размер в конструктор.
There was a problem hiding this comment.
| int numberOf�ompletedBuckets = 0; | |
| int numberOfCompletedBuckets = 0; |
There was a problem hiding this comment.
Хеш-таблице tail не нужен, потому что список в среднем будет из одного элемента. Раз у Вас всё равно специализированный список, то можно и убрать. Это и код упростит
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Эта штука вроде вообще не нужна теперь
There was a problem hiding this comment.
Так лучше было бы назвать не head, а element или что-то такое. Это ведь голова списка только до первого head = head->next;
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
| free(element); | |
| } | |
| free(element); | |
| } |
There was a problem hiding this comment.
Ну, по-хорошему если resize не отработал, то стоит старый table не портить — транзакционность. Но ладно :)
| maximumListLength = listLength; | ||
| } | ||
| } | ||
| printf("maximum list lenght = %d\n", maximumListLength); |
No description provided.